


class A {
    public int data;

   public void func() {
        synchronized (this) {
            System.out.println("我是被加锁的方法");
        }
    }
   public static void fff() {
        synchronized (A.class) {
        }
    }

}


public class Test2 {
    public static void main(String[] args) {
        Object obj = new Object();
        synchronized (obj) {
            System.out.println("锁内部的内容");
        }
    }
}
